import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns


def histogram():
    data_n1 = np.random.normal(-1, 2, 1000)
    data_n2 = np.random.normal(0, 1, 5000)
    data_n1 = pd.DataFrame(data_n1, columns=['normal'])
    data_n2 = pd.DataFrame(data_n2, columns=['normal'])
    data_n1['normal'].plot.hist(bins=30, figsize=(10, 6), alpha=0.5)
    data_n2['normal'].plot.hist(bins=30, figsize=(10, 6), alpha=0.5)
    plt.show()


def scatter():
    sns.set(style="ticks")
    df = sns.load_dataset("anscombe")
    sns.lmplot(x="x", y="y", col="dataset", hue="dataset", data=df,
               col_wrap=2, ci=None, palette="muted", height=4,
               scatter_kws={"s": 50, "alpha": 1})
    plt.show()


def he_tu():
    sns.set(style="ticks", palette="pastel")
    tips = sns.load_dataset("tips")
    sns.boxplot(x="day", y="total_bill", hue="sex", palette=["m", "g"],
                data=tips)
    sns.despine(offset=10, trim=True)
    plt.show()


if __name__ == '__main__':
    # histogram()
    # scatter()
    he_tu()
